package com.cameronyule.echonest
{
	import com.cameronyule.echonest.api.artist.Artist;

	public class EchoNest
	{
		public static const VERSION:String = '0.1';
		
		public static const API_VERSION:String = '3';
		public static const API_URL:String = 'http://developer.echonest.com/api/';
		
		CONFIG::debugging
		private static const DEBUGGING:Boolean = true;
		CONFIG::release
		private static const DEBUGGING:Boolean = false;
		
		public var apiKey:String;
		public var apiVersion:String;
		public var debugging:Boolean;
		
		private var _artist:Artist;
		
		/**
		 * Implementation of The Echo Nest API.
		 * 
		 * http://developer.echonest.com/
		 * 
		 * @param apiKey		Your Echo Nest API Key
		 * @param apiVersion	The API version you are calling (optional)
		 * @param debugging		Enable debugging mode (optional)
		 **/
		public function EchoNest(apiKey:String, apiVersion:String = API_VERSION, debugging:Boolean = DEBUGGING)
		{
			this.apiKey = apiKey;
			this.apiVersion = apiVersion;
			this.debugging = debugging;
			
			initialiseAPIClasses();
		}
		
		private function initialiseAPIClasses():void
		{
			_artist = new Artist(apiKey, apiVersion);
		}
		
		public function get artist():Artist
		{
			return _artist;
		}
	}
}